# -*- coding: utf-8 -*-

_global_dict = {}

def set_cookie(key, value):
    """ 定义一个全局变量 """
    if key:
        _global_dict[key] = value

def get_cookie(key, defValue=None):
    '''
    获得一个全局变量,不存在则返回默认值
    :param key: 
    :param defValue: 
    :return: 
    '''
    if not key:
        return defValue
    return _global_dict.get(key, defValue)